package per.frank.demo.service.a.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import per.frank.demo.service.c.ServiceBApi;

import javax.annotation.PostConstruct;
import java.util.concurrent.*;

@RestController
@RequestMapping("api")
public class AController {
    @Reference
    ServiceBApi serverBimpl;


    @RequestMapping("say")
    public String get() {
        return serverBimpl.sayHello();
    }


//    @PostConstruct
//    public void tesss() throws InterruptedException {
//        ExecutorService pool = Executors.newFixedThreadPool(10);
//
//        for (int i = 0; i < 10; i++) {
//            pool.execute(() -> {
//              while (true) {
//                  serverBimpl.sayHello("abc");
//              }
//            });
//        }

//        CountDownLatch a = new CountDownLatch(1);
//        a.await();
//    }


}
